package edu.uic.cs.i422.s2011.team4;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView;

public class PredatorObservation extends Activity implements OnClickListener {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		  
		      View inflatedView = View.inflate(this, R.layout.predator, null);
		        SquirrelUIGenerator squirrel = new SquirrelUIGenerator(this);
		        squirrel.setTitle(R.string.predatorTitle);
		        squirrel.setHelp(R.string.predatorHelp);
		        squirrel.setBreadCrumb(R.string.predatorBreadCrumb);
		        LinearLayout layout = new LinearLayout(this);
		        layout.setOrientation(LinearLayout.VERTICAL); //Set Oritentation
		        layout.addView(squirrel.getHeader());
		        layout.addView(inflatedView);
		        setContentView(layout);
		final  Button doneButton = (Button) findViewById(R.id.pred_done);
		        
		     
		final SeekBar seekBar1 = (SeekBar) findViewById(R.id.seekBar1);
		final TextView seekBarValue1 = (TextView) findViewById(R.id.dogText);
		final SeekBar seekBar2 = (SeekBar) findViewById(R.id.SeekBar01);
		final TextView seekBarValue2 = (TextView) findViewById(R.id.catText);
		final SeekBar seekBar3 = (SeekBar) findViewById(R.id.SeekBar02);
		final TextView seekBarValue3 = (TextView) findViewById(R.id.coyoteText);
		final SeekBar seekBar4 = (SeekBar) findViewById(R.id.SeekBar03);
		final TextView seekBarValue4 = (TextView) findViewById(R.id.hawkText);
		final SeekBar seekBar5 = (SeekBar) findViewById(R.id.SeekBar04);
		final TextView seekBarValue5 = (TextView) findViewById(R.id.grainText);
		
		doneButton.setOnClickListener(this);
		seekBar1.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

			public void onProgressChanged(SeekBar seekBar, int progress,
					boolean fromUser) {
				// TODO Auto-generated method stub

				String temp = "";
				switch (progress) {
				case 0:
					temp = "None";
					break;
				case 1:
					temp = "Low";
					break;
				case 2:
					temp = "Medium";
					break;
				case 3:
					temp = "High";
					break;
				default:
					temp = "Unknown.";
					break;
				}
				seekBarValue1.setText(temp);
			}

			public void onStartTrackingTouch(SeekBar seekBar) {
				// TODO Auto-generated method stub
			}

			public void onStopTrackingTouch(SeekBar seekBar) {
				// TODO Auto-generated method stub
			}
		});
		seekBar2.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

			public void onProgressChanged(SeekBar seekBar, int progress,
					boolean fromUser) {
				// TODO Auto-generated method stub

				String temp = "";
				switch (progress) {
				case 0:
					temp = "None";
					break;
				case 1:
					temp = "Low";
					break;
				case 2:
					temp = "Medium";
					break;
				case 3:
					temp = "High";
					break;
				default:
					temp = "Unknown.";
					break;
				}
				seekBarValue2.setText(temp);
			}

			public void onStartTrackingTouch(SeekBar seekBar) {
				// TODO Auto-generated method stub
			}

			public void onStopTrackingTouch(SeekBar seekBar) {
				// TODO Auto-generated method stub
			}
		});
		seekBar3.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

			public void onProgressChanged(SeekBar seekBar, int progress,
					boolean fromUser) {
				// TODO Auto-generated method stub

				String temp = "";
				switch (progress) {
				case 0:
					temp = "None";
					break;
				case 1:
					temp = "Low";
					break;
				case 2:
					temp = "Medium";
					break;
				case 3:
					temp = "High";
					break;
				default:
					temp = "Unknown.";
					break;
				}
				seekBarValue3.setText(temp);
			}

			public void onStartTrackingTouch(SeekBar seekBar) {
				// TODO Auto-generated method stub
			}

			public void onStopTrackingTouch(SeekBar seekBar) {
				// TODO Auto-generated method stub
			}
		});
		seekBar4.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

			public void onProgressChanged(SeekBar seekBar, int progress,
					boolean fromUser) {
				// TODO Auto-generated method stub

				String temp = "";
				switch (progress) {
				case 0:
					temp = "None";
					break;
				case 1:
					temp = "Low";
					break;
				case 2:
					temp = "Medium";
					break;
				case 3:
					temp = "High";
					break;
				default:
					temp = "Unknown.";
					break;
				}
				seekBarValue4.setText(temp);
			}

			public void onStartTrackingTouch(SeekBar seekBar) {
				// TODO Auto-generated method stub
			}

			public void onStopTrackingTouch(SeekBar seekBar) {
				// TODO Auto-generated method stub
			}
		});
		seekBar5.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

			public void onProgressChanged(SeekBar seekBar, int progress,
					boolean fromUser) {
				// TODO Auto-generated method stub

				String temp = "";
				switch (progress) {
				case 0:
					temp = "None";
					break;
				case 1:
					temp = "Low";
					break;
				case 2:
					temp = "Medium";
					break;
				case 3:
					temp = "High";
					break;
				default:
					temp = "Unknown.";
					break;
				}
				seekBarValue5.setText(temp);
			}

			public void onStartTrackingTouch(SeekBar seekBar) {
				// TODO Auto-generated method stub
			}

			public void onStopTrackingTouch(SeekBar seekBar) {
				// TODO Auto-generated method stub
			}
		});


	}

	public void onClick(View arg0) {
    	finish();
	}

}
